<%--
  Created by IntelliJ IDEA.
  User: Chen
  Date: 2016/2/27
  Time: 23:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fns" uri="/WEB-INF/tlds/fns.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>

<c:set var="ctx" value="${pageContext.request.contextPath}" />

<h4>论文管理<a class="btn-link btn-sm" href="${ctx }/admin/paper/form" class="btn-link"><span class="glyphicon glyphicon-edit"></span>新论文</a></h4>
<form class="form-inline well" role="form" id="search-form">

    <div class="form-group">
        <label for="postTitle">标题:</label>
        <input class="form-control input-sm" name="postTitle" id="postTitle" size="30" type="text">
    </div>
    <div class="form-group">
        <label for="status">状态:</label>
        <select class="form-control span2" id="status" name="status" >
            <option value="">全部</option>
            <c:forEach items="${fns:getDictList('advertise_status')}" var="dict">
                <option value=" ${dict.value}">${dict.label}</option>
            </c:forEach>
        </select>
    </div>
    <button type="button" class="btn btn-primary btn-sm btn-search-submit">确认</button>
    <a href="${ctx }/admin/advertise/manage" class="btn btn-default btn-sm">刷新</a>
</form>

<div id="list-data"></div>
<script id="list-template" type="text/html">
    <table id="advertise-table" class="table table-striped table-hover">
        <thead>
        <tr>
            <th style="width:3%;" ><input type="checkbox" name="post[]" value="24"></th>
            <th style="width:3%;">#</th>
            <th style="width:30%;">文件编号</th>
            <th style="width:15%;">上传时间</th>
            <%--<th style="width:10%;">题目</th>--%>
        </tr>
        </thead>
        {{each result as value i}}
        <tr>
            <td><input type="checkbox" name="post[]" value="24"></td>
            <td>{{ value.id }}</td>
            <td>{{value.attachment}}
                <div class="row-actions">
                    <a class="btn-link" href="${ctx}/admin/advertise/form?id={{ value.id }}">编辑</a>|
                    <a class="btn-link advertise-del" data='{"id":"{{ value.id }}"}'>删除</a>|
                    <a class="btn-link" href="${ctx}/p?p={{ value.id }}">查看</a>
                </div>
            </td>
            <td><span class="timeago" title="{{value.uploadDate}}"></span></td>
            <%--<td>{{value.choice.topic.name}}</td>--%>
      </tr>
            {{/each}}
        </table>
</script>



<script type="text/javascript">
    <c:if test="${env == 'pro' }">
    requirejs(['${ctx}/assets/js/app/admin/paper-manage-page.js']);
    </c:if>
    <c:if test="${env != 'pro' }">
    requirejs(['${ctx}/assets/js/app/admin/paper-manage-page.js']);
    </c:if>
</script>
